package cn.itcast.health.mobile.controller;


import cn.itcast.health.commons.entity.Result;
import cn.itcast.health.commons.utils.LogUtils;
import cn.itcast.health.interfaces.service.SetmealService;
import cn.itcast.health.mobile.logs.OperationLog;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("setmealMobile")
public class SetmealMobileController {
    @Reference
    private SetmealService setmealService;

    @GetMapping("/findAllSetmealData.do")
    @OperationLog(moduleName = LogUtils.Module.MOBILE, operationType = LogUtils.Type.QUERY, operationContent = "移动端查询所有套餐")
    public Result findAllSetmealData(){
        Result result = setmealService.findAllSetmealData();
        return result;
    }

    @GetMapping("/findSetMealDetail.do")
    @OperationLog(moduleName = LogUtils.Module.MOBILE, operationType = LogUtils.Type.QUERY, operationContent = "移动端根据套餐id查询所有检查组和检查项")
    public Result findSetMealDetail(@RequestParam("id") Integer id){
        Result result = setmealService.findSetMealDetail(id);
        return result;
    }

    @GetMapping("/findByData.do")
    @OperationLog(moduleName = LogUtils.Module.MOBILE, operationType = LogUtils.Type.QUERY, operationContent = "移动端根据预约单id和预约时间查询预约成功后所需要显示的数据")
    public Result findByData(@RequestParam("id") Integer id,@RequestParam("orderDate") String orderDate){
        Result result = setmealService.findByData(id,orderDate);
        return result;
    }

    @GetMapping("/yuyuedata.do")
    @OperationLog(moduleName = LogUtils.Module.MOBILE, operationType = LogUtils.Type.QUERY, operationContent = "移动端用户id查询当前用户所有预约信息")
    public Result yuyuedata(@RequestParam("id") Integer id){
        Result result = setmealService.yuyuedata(id);
        return result;
    }
}
